<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <title>Document</title>
</head>

<body>
    <div id="app">
        <App></App>
        <Header></Header>
    </div>
    <script>
        const Header = Vue.extend( {
            template:`
                <div>
                    <h3>Header组件</h3>
                </div>
            `
        })
        const App = Vue.extend({
            template:`
                <div>
                    <button @click="change">点击</button>
                    <h3>App{{count}}</h3>
                </div>
            `,
            data(){
                return{
                    count:0
                }
            },
            methods:{
                change(){
                    this.count++
                }
            }
        })

        const vm = new Vue({
            el:"#app",
            data(){
                return{
                    
                }
            },
            components:{
                App,
                Header,
            }
        }).$mount("#app")

    </script>
</body>

</html>